class Animal {
    name: string
    constructor(name: string) {
        this.name = name
    }
    sayName() {
        console.log('object' + this.name);

    }
}

// const per=new Person('路飞')
// console.log(per);
// per.name='110'
// console.log(per);
class Dog extends Animal {
    age: number
    constructor(name: string, age: number) {
        super(name)
        this.age = age
    }
    run() {
        console.log('我会跑');

    }
    sayName() {
        super.sayName
    }

}
class Cat extends Animal {
    ps() {
        console.log('我会爬树');

    }
}
const wangcai = new Dog('旺财')
const mini = new Cat('喵喵')
wangcai.run()
wangcai.sayName()
mini.ps()
console.log(wangcai);



